<h1><?php echo admin_breadcrumb(get_breadcrumb($category->id,TRUE)) ?></h1>
<div class="search">
	<form method="get">
		<label>หัวข้อ: </label>
		<input type="text" name="search" value="<?php echo (isset($_GET['search']))?$_GET['search']:'' ?>" /> 
		<input type="submit" value="ค้นหา" class="button" />
	</form>
</div>
<table class="list">
	<tr>
		<th width="60">แสดง</th>
		<th>หัวข้อ</th>
		<?php if($category->structure->type=='download'): ?>
		<th></th>
		<?php endif;?>
		<th width="120">โดย</th>
		<th width="90"><a class="btn" href="contents/admin/contents/form/<?php echo $category->id ?>">เพิ่มรายการ</a></th>
	</tr>
	<?php foreach($contents as $content): ?>
	<tr <?php echo cycle()?>>
		<td><input type="checkbox" name="status" value="<?php echo $content->id ?>" <?php echo ($content->status=="approve")?'checked="checked"':'' ?>  /></td>
		<td>
			<?php echo lang_decode($content->title,'th');?>
		</td>
		<?php if($category->structure->type=='download'): ?>
		<td><?php echo (is_file('uploads/content/download/'.$content->file))?anchor('contents/download/'.$content->id,'ดาวน์โหลด'):'' ?></td>
		<?php endif;?>
		<td><?php echo $content->user->fullname?></td>
		<td>
			<a class="btn" href="contents/admin/contents/form/<?php echo $category->id ?>/<?php echo $content->id?>" >แก้ไข</a> 
			<a class="btn" href="contents/admin/contents/delete/<?php echo $content->id?>" onclick="return confirm('<?php echo lang('notice_confirm_delete');?>')">ลบ</a>
		</td>
		</tr>
		<?php endforeach; ?>
	</table>
<?php echo $contents->pagination()?>